<template>
    <div class="edu-page-warp" :style="indexKey == 2 ? { height: '100%' } : null">
        <InnerBreadcrumb v-model="indexKey" :path="breadPath" :showBack="true" />
        <div v-show="indexKey == '1'" class="condition">
            <condition-card
                @reset="reset"
                @search="onSubmit"
                label-width="120px"
                :advance="advanceBtnVisible.search"
                businessType="studentList"
                fieldsApi="/api/studentservice/advancedQuery/findFieldInfo"
                searchApi="/api/studentservice/advancedQuery/findResultList"
                searchApiMethod="post"
                :searchParm="searchParm"
                @advanceQuery="advanceQuery"
            >
                <template slot="other-btn" v-if="advanceBtnVisible.importSearch">
                    <el-dropdown @command="handleCommand">
                        <el-button type="primary">导入查询</el-button>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item command="download">下载导入模板</el-dropdown-item>
                            <el-dropdown-item command="import">导入查询</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </template>
                <slot>
                    <el-row :gutter="24">
                        <el-col :span="8">
                            <!-- 当前年级 -->
                            <el-form-item :label="$t('label.nowGrade')">
                                <el-date-picker
                                    clearable
                                    v-model="queryForm.grade"
                                    value-format="yyyy"
                                    type="year"
                                    :placeholder="$t('common.text.all')"
                                    style="width: 100%"
                                    @change="currentDptId === '1'? changeGrade(): ''"
                                />
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 学院 -->
                            <el-form-item :label="$t('label.college')" id="faculty" v-if="currentDptId == '1' && isShowAllFaculty()">
                                <el-select
                                    v-model="queryForm.facultyList"
                                    filterable
                                    @change="changeFaculty"
                                    style="width:100%;height:33px"
                                    clearable
                                    multiple
                                    collapse-tags
                                >
                                    <el-option
                                        v-for="item in options.allFaculty"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                            <el-form-item :label="$t('label.college')" id="faculty" v-else>
                                <el-select
                                    v-model="queryForm.facultyList"
                                    filterable
                                    @change="changeFaculty"
                                    style="width:100%;height:33px"
                                    clearable
                                    multiple
                                    collapse-tags
                                >
                                    <el-option
                                        v-for="item in options.faculty"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                            
                        </el-col>
                        <!-- <el-col :span="8" v-if="showSchool">
                            <el-form-item :label="$t('school.school')">
                                <el-select
                                    v-model="queryForm.schoolId"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.school"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>-->

                        <el-col :span="8">
                            <!-- 培养专业 -->
                            <el-form-item :label="$t('label.trainingMajor')">
                                <el-select
                                    v-model="queryForm.professionList"
                                    filterable
                                    style="width:100%;height:33px"
                                    clearable
                                    multiple
                                    collapse-tags
                                    @change="getProfessDirectNames"
                                >
                                    <el-option
                                        v-for="item in options.profession"
                                        :key="item.value"
                                        :label="item.label+'('+item.value+')'"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="24">
                        <el-col :span="8">
                            <!-- 培养层次 -->
                            <el-form-item :label="$t('label.trainingLevel')">
                                <el-select
                                    v-model="queryForm.trainingLevelList"
                                    style="width:100%"
                                    clearable
                                    multiple
                                    collapse-tags
                                >
                                    <el-option
                                        v-for="item in options.trainingLevel"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 培养类别 -->
                            <el-form-item :label="$t('label.trainingCategory')">
                                <el-select
                                    v-model="queryForm.trainingCategory"
                                    style="width:100%"
                                    multiple
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.trainingCategory"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>

                        <el-col :span="8">
                            <!-- 学位类型 -->
                            <el-form-item :label="$t('dic.degreeType')">
                                <el-select
                                    v-model="queryForm.degreeType"
                                    multiple
                                    style="width:100%"
                                    @change="
                                        currentDptId !== '1'
                                            ? changeGrade()
                                            : ''
                                    "
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.degreeType"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        </el-row>
                        <el-row :gutter="24">
                        <el-col :span="8">
                            <el-form-item label="学位上报类别">
                                <el-select
                                    v-model="queryForm.degreeCategory"
                                    style="width:100%"
                                    multiple
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.degreeCategory"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 校区 -->
                            <el-form-item :label="$t('label.campus')">
                                <el-select v-model="queryForm.campus" multiple style="width:100%" clearable>
                                    <el-option
                                        v-for="item in options.campus"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>

                        <el-col :span="8">
                            <!-- 性别 -->
                            <el-form-item :label="$t('label.sex')">
                                <el-select v-model="queryForm.sex" style="width:100%" clearable>
                                    <el-option
                                        v-for="item in options.sex"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        </el-row>
                        <el-row :gutter="24">
                        <el-col :span="8">
                            <!-- 学习形式 -->
                            <el-form-item :label="$t('label.formLearning')">
                                <el-select
                                    v-model="queryForm.formLearning"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.formLearning"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 入学方式 -->
                            <el-form-item :label="$t('label.enrolMethod')">
                                <el-select
                                    style="width:100%"
                                    v-model="queryForm.enrolMethods"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.enrolMethods"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>

                        <el-col :span="8">
                            <!-- 是否国际学生 -->
                            <el-form-item :label="$t('label.isOverseas')">
                                <el-select
                                    v-model="queryForm.isOverseas"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.isOverseas"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        </el-row>
                        <el-row :gutter="24">
                        <el-col :span="8">
                            <el-form-item label="是否港澳台">
                                <el-select
                                    v-model="queryForm.chinaSon"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.isChinaSon"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 入学季节 -->
                            <el-form-item :label="$t('label.enrolSeason')">
                                <el-select
                                    v-model="queryForm.enrolSeason"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.enrolSeason"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 录取类别 -->
                            <el-form-item :label="$t('label.enrolCategory')">
                                <el-select
                                    style="width:100%"
                                    v-model="queryForm.enrolCategoryList"
                                    clearable
                                    multiple
                                    collapse-tags
                                >
                                    <el-option
                                        v-for="item in options.enrolCategory"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        </el-row>
                        <el-row :gutter="24">
                        <el-col :span="8">
                            <!-- 是否在籍 -->
                            <el-form-item :label="$t('label.registrationStatus')">
                                <el-select
                                    v-model="queryForm.isMembership"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.isMembership"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <!-- 在校状态 -->
                            <el-form-item :label="$t('label.leaveSchool')">
                                <el-select
                                    v-model="queryForm.leaveSchool"
                                    style="width:100%"
                                    clearable
                                    multiple

                                >
                                    <el-option
                                        v-for="item in options.leaveSchool"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="合作类型">
                                <el-select
                                    v-model="queryForm.unionType"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.unionType"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="24">
                        <!-- 入学年级 -->
                        <el-col :span="8">
                            <el-form-item :label="$t('label.comeGrade')">
                                <el-date-picker
                                    clearable
                                    v-model="queryForm.enrolGrade"
                                    value-format="yyyy"
                                    type="year"
                                    :placeholder="$t('common.text.all')"
                                    style="width: 100%"
                                />
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="专项计划">
                            <el-select
                                v-model="queryForm.specialPlan"
                                style="width:100%"
                                clearable
                            >
                                <el-option
                                v-for="item in options.specialPlanList"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                                />
                            </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8" v-if="userInfo.currentManageDptId !== '1'">
                            <!-- 门类 -->
                            <el-form-item label="门类">
                                <el-select
                                v-model="queryForm.category"
                                style="width:100%"
                                clearable
                                filterable
                                >
                                <el-option
                                    v-for="item in options.category"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8" v-if="userInfo.currentManageDptId === '1'">
                            <el-form-item label="学籍学院">
                                <el-select
                                    v-model="queryForm.statusFacultyList"
                                    filterable
                                    @change="changeStuFaculty"
                                    style="width:100%;"
                                    clearable
                                    multiple
                                    collapse-tags
                                >
                                    <el-option
                                        v-for="item in options.faculty"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8" v-if="userInfo.currentManageDptId === '1'">
                            <el-form-item label="学籍专业">
                                <el-select
                                    v-model="queryForm.statusProfession"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in options.statusMajorList"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8" v-if="userInfo.currentManageDptId === '1'">
                            <el-form-item label="专业方向名称">
                                <el-select
                                    v-model="queryForm.majorDirectionCode"
                                    style="width:100%"
                                    clearable
                                >
                                    <el-option
                                        v-for="item in ZYFXMCOptions"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </slot>
            </condition-card>
            <el-card shadow="never">
                <div class="edu-page-title">{{ $t("message.studentList") }}</div>
                <el-row class="border-bottom" style="height:56px;">
                    <el-col :span="3">
                        <el-select v-model="queryForm.statue" @change="changeval()">
                            <el-option label="按学生搜索" :value="0" />
                            <el-option label="按导师搜索" :value="1" />
                        </el-select>
                    </el-col>
                    <el-col :span="4">
                        <el-input
                            v-show="queryForm.statue === 0"
                            v-model="queryForm.name"
                            :placeholder="$t('score.failScoreManage.pleaseInt')"
                            @keyup.enter.native="queryByCode"
                            style="width:200px"
                        >
                            <i
                                class="el-icon-search"
                                slot="suffix"
                                style="margin-top:10px;cursor:pointer"
                                @click="queryByCode"
                            ></i>
                        </el-input>
                    </el-col>
                    <el-col :span="4">
                        <el-input
                            v-show="queryForm.statue === 1"
                            v-model="queryForm.teacherCodeAndName"
                            placeholder="请输入导师工号、姓名搜索"
                            @keyup.enter.native="queryByCode"
                            style="width:200px"
                        >
                            <i
                                class="el-icon-search"
                                slot="suffix"
                                style="margin-top:10px;cursor:pointer"
                                @click="queryByCode"
                            ></i>
                        </el-input>
                    </el-col>
                    <el-col :span="5">
                        <div class="empty-box" />
                    </el-col>
                    <el-col :span="12">
                        <div class="float-right">
                            <el-button type="primary" @click="exportPicture()">照片导出</el-button>
                            <advance-import-export-stu
                                :show-import="advanceBtnVisible.import"
                                :show-export="advanceBtnVisible.export"
                                business-type="studentList"
                                fieldsApi="/api/studentservice/studentDic/findAllStuDicts"
                                condition-export-api="/api/studentservice/studentInfo/exportStuInfoListExcel"
                                ids-export-api="/api/studentservice/studentInfo/exportStudentList/excel"
                                @change-scheme="handleChangeScheme"
                                :asyn-export="true"
                                :getExportParamMethod="getExportParamMethod"
                                importApi="/api/studentservice/advancedImpExp/advanImportStuInfo"
                            />
                            <update-import
                                :updateImport="advanceBtnVisible.updateImport"
                                business-type="updateImport"
                                fieldsApi="/api/studentservice/studentDic/findAllStuDicts"
                                @change-scheme="handleChangeScheme"
                                importApi="/api/studentservice/advancedImpExp/importAndUpdateStu"
                            />
                            <!--:export-total="queryForm.total"-->
                        </div>
                    </el-col>
                </el-row>
                <el-table
                    :data="students"
                    size="mini"
                    @selection-change="handleSelectionChange"
                    style="width:100%"
                >
                    <!-- 本科生列表 -->
                    <template v-if="isUndergraduate()">
                      <el-table-column type="selection" stripe fixed="left"/>
                      <el-table-column
                        prop="studentId"
                        :label="$t('label.stuCode')"
                        fixed="left"
                        width="120px"
                      />
                      <el-table-column
                        :label="$t('label.stuName')"
                        fixed="left"
                        width="100px"
                        prop="name"
                      ></el-table-column>
                      <el-table-column :label="$t('label.sex')" fixed="left">
                        <template slot-scope="scope">
                          {{
                          getSexLabel(scope.row.sex)
                          }}
                        </template>
                      </el-table-column>
                      <el-table-column :label="$t('label.nowGrade')" prop="grade" fixed="left"></el-table-column>
                      <el-table-column
                        :label="$t('label.college')"
                        width="100"
                        fixed="left"
                        show-overflow-tooltip
                        prop="facultyI18n"
                      ></el-table-column>
                      <!-- <el-table-column
                          :label="$t('school.school')"
                          width="100"
                          show-overflow-tooltip
                          v-if="showSchool"
                          prop="schoolName"
                      ></el-table-column>-->
                      <el-table-column :label="$t('label.trainingMajor')" width="100" show-overflow-tooltip fixed="left">
                        <template slot-scope="scope">
                          {{
                          global.projectId * 1 == 1
                          ? scope.row.cultureProfessionName
                          : scope.row.cultureProfessionI18n
                          }}
                        </template>
                      </el-table-column>
                      <el-table-column label="学籍专业" width="100" show-overflow-tooltip>
                        <template slot-scope="scope">
                          {{
                          global.projectId * 1 == 1
                          ? scope.row.statusProfessionName
                          : scope.row.statusProfessionI18n
                          }}
                        </template>
                      </el-table-column>
                      <el-table-column label="学籍学院" width="140" prop="statusFacultyI18n" show-overflow-tooltip v-if="global.projectId * 1 == 1">
                      </el-table-column>
                      <el-table-column label="学籍状态" width="100" prop="registrationStatusI18n" show-overflow-tooltip>
                      </el-table-column>
                      <el-table-column
                        :label="$t('label.trainingCategory')"
                        width="100"
                        prop="trainingCategoryI18n"
                      ></el-table-column>
                      <el-table-column
                        :label="$t('label.trainingLevel')"
                        width="100"
                        prop="trainingLevelI18n"
                      ></el-table-column>
                      <el-table-column
                        label="专业方向"
                        prop="majorDirectionName"
                        width="120"
                        show-overflow-tooltip
                      />
                      <!--<el-table-column
                        :label="$t('dic.degreeType')"
                        prop="degreeTypeI18n"
                        width="120"
                      ></el-table-column>
                      <el-table-column label="学位上报类别" prop="degreeCategoryI18n" width="150"></el-table-column>-->
                      <el-table-column label="导师" prop="teacherCodeAndName" width="150"></el-table-column>
                      <el-table-column :label="$t('label.registrationStatus')" width="120">
                        <template slot-scope="scope">
                          <el-tag
                            type="danger"
                            v-if="scope.row.isMembership == 0"
                          >{{ scope.row.isMembershipI18n }}</el-tag>
                          <el-tag
                            type="success"
                            v-else-if="scope.row.isMembership == 1"
                          >{{ scope.row.isMembershipI18n }}</el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column
                        :label="$t('label.formLearning')"
                        width="150"
                        prop="formLearningI18n"
                      ></el-table-column>
                      <el-table-column
                        :label="$t('label.enrolMethod')"
                        width="150"
                        prop="enrolMethodsI18n"
                      ></el-table-column>
                      <el-table-column :label="$t('label.campus')" width="100" prop="campusI18n"></el-table-column>
                      <el-table-column
                        :label="$t('label.enrolSeason')"
                        width="100"
                        prop="enrolSeasonI18n"
                      ></el-table-column>
                      <el-table-column
                        :label="$t('label.leaveSchool')"
                        width="100"
                        prop="leaveSchoolI18n"
                      ></el-table-column>
                      <el-table-column :label="$t('label.isOverseas')" width="120">
                        <template slot-scope="scope">
                          <el-tag
                            type="danger"
                            v-if="scope.row.isOverseas == 0"
                          >{{ scope.row.isOverseasI18n }}</el-tag>
                          <el-tag
                            type="success"
                            v-else-if="scope.row.isOverseas == 1"
                          >{{ scope.row.isOverseasI18n }}</el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column label="是否港澳台" prop="chinaSon" width="120">
                        <template slot-scope="scope">
                          <el-tag
                            type="danger"
                            v-if="scope.row.chinaSon == '否'"
                          >{{ scope.row.chinaSon }}</el-tag>
                          <el-tag
                            type="success"
                            v-else-if="scope.row.chinaSon == '是'"
                          >{{ scope.row.chinaSon }}</el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column
                        :label="$t('label.enrolCategory')"
                        width="200"
                        prop="enrolCategoryI18n"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column
                        label="合作类型"
                        show-overflow-tooltip
                        width="200"
                        prop="unionTypeI18n"
                      ></el-table-column>
                    </template>
                    <!-- 研究生列表 -->
                    <template v-if="isGraduateStudent()">
                      <el-table-column type="selection" stripe fixed="left"/>
                      <el-table-column prop="studentId" label="学号" fixed="left" width="120px"/>
                      <el-table-column prop="name" label="姓名" fixed="left" width="100px"/>
                      <el-table-column prop="trainingLevelI18n" label="培养层次" fixed="left" width="120px"/>
                      <el-table-column prop="teacherCodeAndName" label="导师" fixed="left" width="120px"/>
                      <el-table-column prop="grade" label="年级" width="120px"/>
                      <!-- 教务员权限该字段不显示，留办、校级管理员等权限显示该字段 -->
                      <el-table-column prop="facultyI18n" label="学院" width="160px" v-if="isShowFaculty()"/>
                      <el-table-column prop="trainingCategoryI18n" label="培养类别" width="120px"/>
                      <el-table-column prop="cultureProfessionI18n" label="培养专业" width="120px"/>
                      <el-table-column prop="registrationStatusI18n" label="学籍状态" width="120px"/>
                      <el-table-column label="是否在籍" width="120px">
                        <template slot-scope="scope">
                          <el-tag
                            type="danger"
                            v-if="scope.row.isMembership == 0"
                          >{{ scope.row.isMembershipI18n }}</el-tag>
                          <el-tag
                            type="success"
                            v-else-if="scope.row.isMembership == 1"
                          >{{ scope.row.isMembershipI18n }}</el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column prop="leaveSchoolI18n" label="在校状态" width="120px"/>
                      <el-table-column prop="degreeTypeI18n" label="学位类型" width="120px"/>
                      <el-table-column prop="formLearningI18n" label="学习形式" width="120px"/>
                      <el-table-column prop="categoryI18n" label="门类" width="120px"/>
                      <el-table-column label="是否国际生" width="120px">
                        <template slot-scope="scope">
                          <el-tag
                            type="danger"
                            v-if="scope.row.isOverseas == 0"
                          >{{ scope.row.isOverseasI18n }}</el-tag>
                          <el-tag
                            type="success"
                            v-else-if="scope.row.isOverseas == 1"
                          >{{ scope.row.isOverseasI18n }}</el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column prop="stateI18n" label="国家地区" width="120px"/>
                      <el-table-column prop="campusI18n" label="校区" width="120px"/>
                      <el-table-column prop="enrolDate" label="入学时间" width="120px">
                        <template slot-scope="scope">
                          {{$moment(scope.row.enrolDate).format("YYYY-MM-DD")}}
                        </template>
                      </el-table-column>
                      <el-table-column label="性别" width="120px">
                        <template slot-scope="scope">
                          {{
                          getSexLabel(scope.row.sex)
                          }}
                        </template>
                      </el-table-column>
                      <el-table-column prop="researchDirection" label="研究方向" width="160px"/>
                      <el-table-column prop="phoneNumber" label="手机号码" width="120px"/>
                    </template>
                    <el-table-column :label="$t('label.operation')" fixed="right">
                        <template slot-scope="scope">
                            <a
                                href="#"
                                @click="viewDetail(scope.row.studentId)"
                            >{{ $t("message.detail") }}</a>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="edu-pagination">
                    <div class="float-right">
                        <el-pagination
                            :current-page="queryForm.pageNum_"
                            :page-sizes="[10, 20, 50, 100, 500]"
                            :page-size="queryForm.pageSize_"
                            :total="queryForm.total"
                            layout="total, sizes, prev, pager, next, jumper"
                            style="float: right;margin:10px 60px 0 0;"
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                        />
                    </div>
                </div>
                <span
                    style="cursor:pointer;display:inline-block;width:100px;height:30px"
                    @click="mockData"
                ></span>
            </el-card>
        </div>

        <student-base-info v-if="indexKey == '2'" :sid="studentId" />
        <edu-dialog ref="uploadDialog" title="导入查询" width="600px">
            <el-form label-width="85px">
                <el-form-item>
                    <el-upload
                        :auto-upload="false"
                        ref="upload"
                        :data="{ pageNum_: 1, pageSize_: 20 }"
                        :on-success="handleSuccess"
                        :on-error="handleError"
                        :before-upload="handleBefore"
                        :limit="1"
                        accept=".xlsx"
                        action="/api/studentservice/studentInfo/importQuery"
                    >
                        <el-button slot="trigger" size="small" type="primary">
                            {{
                            $t("label.selectFile")
                            }}
                        </el-button>
                        <div slot="tip" class="el-upload__tip">只能上传.xlsx文件</div>
                    </el-upload>
                </el-form-item>
            </el-form>
            <template slot="buttons">
                <el-button @click="cancelUpload">
                    {{
                    $t("message.cancel")
                    }}
                </el-button>
                <el-button type="primary" @click="submit">
                    {{
                    $t("message.submit")
                    }}
                </el-button>
            </template>
        </edu-dialog>
    </div>
</template>
<script>
import { findStuInfoList, findStuInfoListExport, getImportTemplate, findStatusProfessionList,getSetMajorDirectionNames, allFacultyList } from 'common/src/api/studentinfo'
import { queryDic } from 'common/src/api/dictionary'
import BPIs from 'common/src/api/welcomeService/schoolRelation'
import studentBaseInfo from '../../../views/student/studentBaseInfoNew'
// import studentBaseInfo from '../../../views/student/studentBaseInfo'
import { downloadfile } from 'common/src/api/upload'
import SchoolCalendarApi from "common/src/api/calendars";
import UTILS from "common/src/utils/utils";
import UpdateImport from './updateImport.vue'
import AdvanceImportExportStu from './AdvanceImportExportStu.vue'
import mixin from 'common/src/mixins/index';
export default {
    name: 'StudentList',
    mixins: [mixin],
    components: {
        studentBaseInfo,
        'update-import': UpdateImport,
        'advance-import-export-stu': AdvanceImportExportStu

    },
    data() {
        return {
            userInfo: {},
            ids: '',
            filist: [],
            ZYFXMCOptions: [],
            searchParm: {},
            queryForm: {
                statue: 0,
                teacherCodeAndName: '', // 老师
                grade: '', //年级
                facultyList: [], //学院
                professionList: [], //专业
                trainingLevelList: [], //培养层次
                trainingCategory: [], //培养类别
                degreeType: [], //学位类型
                campus: [], //校区
                sex: '', //性别
                formLearning: '', //学习形式
                enrolMethods: '', //入学方式
                isOverseas: '0', //是否国际生
                chinaSon: '', //港澳台侨
                enrolSeason: '', //入学季节
                enrolCategoryList: [], //录取类别
                isMembership: '', //是否在籍
                leaveSchool: [], //在校状态
                name: '',
                schoolId: '', //学堂
                degreeCategory: [], // 学位上报类别
                unionType: '', //合作类型
                specialPlan: '', //专项计划
                statusProfession: '', //学籍专业
                enrolGrade: '', // 入学年级
                statusFacultyList: [], // 学籍学院
                majorDirectionCode: '', // 专业方向名称
                pageNum_: 1,
                total: 0,
                pageSize_: 20
            },
            options: {
                faculty: [],
                profession: [],
                trainingLevel: [],
                trainingCategory: [],
                degreeType: [],
                campus: [],
                sex: [],
                formLearning: [],
                enrolMethods: [], //无数据
                isOverseas: [],
                chinaSon: [],
                enrolSeason: [],
                enrolCategory: [],
                isMembership: [],
                leaveSchool: [],
                school: [],
                degreeCategory: [],
                unionType: [],
                statusMajorList: [],
                specialPlanList: [],
                isChinaSon: [],
                category: [],
                allFaculty: [] // 所有学院
            },
            students: [],
            showSchool: false, //是否显示学堂
            currentDptId: null,
            studentId: null,
            indexKey: '1',
            breadPath: {
                label: '学生信息管理',
                key: '1',
                children: [
                    {
                        key: '2',
                        label: '学生详情'
                    }
                ]
            },
            advanceBtnVisible: {
                search: false,
                import: false,
                updateImport: false,
                export: false,
                importSearch: false
            },
            studentIdList: null, //高级查询使用
            exportSchemeId: null, //当前导出方案Id
            defaultGrade: '' //默认年级
        }
    },
    created() {
        this.getColleageList()
    },
    mounted() {
        // 获取当前用户信息
        if (localStorage.getItem('sessiondata')) {
            if (JSON.parse(localStorage.getItem('sessiondata')).mockUser) {
                this.userInfo = JSON.parse(localStorage.getItem('sessiondata')).mockUser
            } else {
                this.userInfo = JSON.parse(localStorage.getItem('user'))
            }
        }
        this.getCurrentTermCalendar().then(resp => {
            this.defaultGrade = resp.data.simpleName.split("-")[0]
            this.queryForm.grade = this.defaultGrade
        })
        this.initOptions()
        this.currentDptId = this.userInfo.currentManageDptId
        // this.initSchool()
        this.initAdvanceBtn()
    },
    methods: {
        // 判断是否为本科生
        isUndergraduate () {
          return this.userInfo.currentManageDptId && this.userInfo.currentManageDptId.toString() === '1';
        },
        // 判断是否为研究生
        isGraduateStudent () {
          const currentManageDptId = this.userInfo.currentManageDptId && this.userInfo.currentManageDptId.toString();
          // return currentManageDptId === '2' || currentManageDptId === '4';
          return currentManageDptId !== '1';
        },
        // 是否显示学院
        isShowFaculty() {
          const innerRoles = this.userInfo.innerRoles || [];
          return innerRoles.includes('1');
        },
        // 是否显示所有学院
        isShowAllFaculty() {
          const innerRoles = this.userInfo.innerRoles || [];
          return innerRoles.includes('2');
        },
        // 判断是否为为研究生
        // 判断当前登录用户是否本科生，取对应学院下拉框数据
        getColleageList() {
            let _this = this
            // 获取登陆用户学院
            let mockUser = JSON.parse(localStorage.getItem('sessiondata')).mockUser
            let user = JSON.parse(localStorage.getItem('sessiondata')).user
        if (mockUser && mockUser.currentManageDptId) {
            // 本科生
            if(mockUser.currentManageDptId == '1') {
                this.searchParm = {
                    api: '/api/externalexchangeservice/ug/university/appoint/universities',
                    method: 'POST',
                    parm: '',
                    label: 'universityNameZN',
                    value: 'universityCode'
                }

            } else {
                this.searchParm = {
                    api: '/api/externalexchangeservice/overseasCollege/getCollegeListByNationCode',
                    method: 'POST',
                    parm: '',
                    label: 'collegeName',
                    value: 'collegeCode'
                }
            }
        } else if (user && user.currentManageDptId) {
            // 本科生
            if(user.currentManageDptId == '1') {
                // 本科生获取学院下拉框数据
                this.searchParm = {
                    api: '/api/externalexchangeservice/ug/university/appoint/universities',
                    method: 'POST',
                    parm: '',
                    label: 'universityNameZN',
                    value: 'universityCode'
                }
            } else {
                // 研究生获取学院下拉框数据
                this.searchParm = {
                    api: '/api/externalexchangeservice/overseasCollege/getCollegeListByNationCode',
                    method: 'POST',
                    parm: '',
                    label: 'collegeName',
                    value: 'collegeCode'
                }
            }
        }
    },
        // 获取所有学院
        getFacultyList() {
            this.options.allFaculty = []
            allFacultyList().then(res=> {
                if(res.code === 200 && res.data) {
                    res.data.forEach(faculty=> {
                        this.options.allFaculty.push({
                        label: faculty.deptName,
                        value: faculty.deptCode
                        })
                    })
                }
            })
        },
        // 获取专业方向名称，传参为培养专业的值
        // 变更：获取专业方向名称，传参变更为年级，学院，专业
        async getProfessDirectNames(val) {
            let _this = this
            _this.ZYFXMCOptions = []
            _this.queryForm.majorDirectionCode = ""
            let currentGrade = _this.queryForm.grade
            if (val && val.length > 0) {
                // const directionNameRes = await getMajorDirectionNames(val)
                getSetMajorDirectionNames({
                    grade: currentGrade,
                    pageNum_: 1,
                    pageSize_: 999999,
                    professionCodes: val
                }).then(directionNameRes => {
                    if (directionNameRes.code === 200 && Array.isArray(directionNameRes.data.list) && directionNameRes.data.list.length > 0) {
                        _this.ZYFXMCOptions = directionNameRes.data.list.map(value => {
                            return {
                                label: this.$store.getters.language === 'en' ? value.nameEn : value.name,
                                value: value.code
                            }
                        })
                    }
                    
                })
            }
             
        },
        // 获取当前学年学期
        async getCurrentTermCalendar(){
            return await SchoolCalendarApi.currentTermCalendar()
        },
        initAdvanceBtn() {
            let session = localStorage.getItem('sessiondata')
            session = JSON.parse(session)
            let user = session.mockUser || session.user
            if (user.uid == 'admin1' || user.innerRoles.includes('1')) {
                this.advanceBtnVisible.search = true
                // this.advanceBtnVisible.import = true

                this.advanceBtnVisible.export = true
                this.advanceBtnVisible.importSearch = true
            }
            if (user.innerRoles.includes('2')) {
                this.advanceBtnVisible.search = true
                this.advanceBtnVisible.export = true
                this.advanceBtnVisible.importSearch = true
            }
            // if(this.global.projectId == '1') {
            //     this.advanceBtnVisible.updateImport = true
            // }
            // 获取当前用户auths权限
            let auths = session.auths
            if (auths) {
                auths.forEach(val => {
                    if (val.authCode === 'studentList-update-Import') {
                        this.advanceBtnVisible.updateImport = true
                    }
                    if (val.authCode === 'studentList-advance-import') {
                        this.advanceBtnVisible.import = true
                    }
                })
            }
        },
        // 轮询直到获取key值的接口返回
        cycleToGetKey() {
                let currentIds = []
                if (this.filist.length > 0) {
                    this.filist.forEach(element => {
                        currentIds.push({name: element.name, studentId: element.studentId, photoFile: element.photoFile})
                    })
                }
                // else {
                //     currentIds = []
                //     this.$message.error("请勾选数据")
                //     return
                // }
                let param = _.cloneDeep(this.queryForm)
                // 处理在校状态
                param.leaveSchool = param.leaveSchool && param.leaveSchool.length > 0 ? param.leaveSchool.join(',') : ''
                // 处理培养类别
                param.trainingCategory = param.trainingCategory && param.trainingCategory.length > 0 ? param.trainingCategory.join(',') : ''
                // 处理学位类型
                param.degreeType = param.degreeType && param.degreeType.length > 0 ? param.degreeType.join(',') : ''
                // 处理学位上报类别
                param.degreeCategory = param.degreeCategory && param.degreeCategory.length > 0 ? param.degreeCategory.join(',') : ''
                // 处理校区
                param.campus = param.campus && param.campus.length > 0 ? param.campus.join(',') : ''
                let obj = currentIds && currentIds.length > 0 ? {} : param
                BPIs.exportStuPicture({
                    students: currentIds,
                    studentListInfoVo: obj
                }).then(res => {
                    let obj = JSON.parse(res.data)
                    if (obj.status == '2') {
                        return this.$message.error(obj.msg)
                    } else {
                        this.$message(obj.msg)
                        this.normalDelayRequest(obj.key)
                    }
                })
        },
        // Normal导出异步
        normalDelayRequest(key, name) {
            setTimeout(() => {
                BPIs.getPictureUrl(key).then(res => {
                    let obj = JSON.parse(res.data)
                    if (obj.status == '2') {
                        return this.$message.error(obj.msg)
                    } else if (obj.status == '1') {
                        this.$message.success(obj.msg)
                        downloadfile(obj.file);
                        // BPIs.getPictureFile(obj.file);
                    } else if (obj.status == '0') {
                        this.normalDelayRequest(key)
                    }
                })
            }, 3000)
        },
        // 照片导出
        exportPicture() {
            // 1、第一步：调该接口，获取key值以及msg中的文件名
            // 2、第二步：将key值放入接口传参
            // 3、第三步：传入path值以及name(msg中的文件名)值，下载文件
            // this.exportResult = null
            // this.$refs.downloadRef.open()
            // this.exportButton = true
            this.cycleToGetKey()
        },
        handleSelectionChange(val) {
            this.ids = ''
            this.filist = val
            /*this.ids = '';*/
            this.filist.forEach(n => {
                /*alert(n.studentId);*/
                this.ids += n.studentId + ','
            })
            this.ids = this.ids.substring(0, this.ids.length - 1)
            /*alert(this.ids);*/
        },
        changeval() {
            this.queryForm.name = ''
            this.queryForm.teacherCodeAndName = ''
            this.onSubmit()
        },
        //初始化本科生学堂
        initSchool() {
            let session = localStorage.getItem('sessiondata')
            session = JSON.parse(session)
            let user = session.mockUser || session.user
            this.currentDptId = user.currentManageDptId
            if (user.currentManageDptId == 1) {
                this.showSchool = true
                BPIs.findSchool({
                    pageNum_: 0,
                    pageSize_: 0,
                    condition: {}
                }).then(res => {
                    if (res.code == 200 && res.data.list.length > 0) {
                        for (const item of res.data.list) {
                            this.options.school.push({
                                label: item.name,
                                value: item.id
                            })
                        }
                    }
                })
            }
        },
        initOptions() {
            this.queryForm['x-token'] =
                this.$store.state.session.sessionid || localStorage.getItem('sessionid') || ''
            const data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: [
                    'X_YX',
                    'X_PYCC',
                    'X_PYLB',
                    'X_XWLX',
                    'X_XQ',
                    'G_XBIE',
                    'X_XXXS',
                    'isAborad',
                    'gat',
                    'X_RXJJ',
                    'K_SF',
                    'X_LXZT',
                    'X_RXFS',
                    'X_LQLB',
                    'X_XWLB',
                    'K_HZLX',
                    'X_ZXJH',
                    'G_ML'
                ]
            }
            queryDic(data).then(res => {
                if (res.code === 200) {
                    this.fillSelect(res.data)
                    this.onSubmit()
                }
            })
           if(this.$store.getters.getGlobal().projectId === '1' && this.isShowAllFaculty()) {
               this.getFacultyList()
           }
        },
        changeFaculty() {
            this.options['profession'] = []
            this.queryForm.professionList = []
            if (this.currentDptId == '1' && this.queryForm.facultyList.length == 0) {
                return
            }
            if (
                this.currentDptId != '1' &&
                this.queryForm.facultyList.length == 0 &&
                !this.queryForm.degreeType
            ) {
                return
            }
            const data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['G_ZY'],
                filter: {
                    prefix: this.queryForm.facultyList,
                    specilaCode: 'XY2ZY',
                    grade: this.queryForm.grade,
                    facultys: this.queryForm.facultyList,
                    degreeType: this.queryForm.degreeType ? this.queryForm.degreeType : []
                }
            }
            queryDic(data).then(res => {
                if (res.code === 200) this._fill('profession', res.data.G_ZY)
            })
        },
        changeGrade() {
            this.changeStuFaculty()
            this.changeFaculty()
        },
        changeStuFaculty() {
            this.options.statusMajorList = []
            this.queryForm.statusProfession = ''
            let parm = {
                grade: this.queryForm.grade,
                statusFacultyList: this.queryForm.statusFacultyList
            }
            if(this.queryForm.statusFacultyList == undefined || this.queryForm.statusFacultyList.length === 0) {
                this.options.statusMajorList = []
                return
            }
            if(this.global.projectId == '1') {
            findStatusProfessionList(parm).then(res=> {
                if(res.code === 200) {
                    res.data.forEach(val=> {
                        this.options.statusMajorList.push(
                            {
                                label: val.professionName + '(' + val.professionCode + ')',
                                value: val.statusProfessionCode
                            }
                        )

                    })

                }

            })
        } else if(this.global.projectId == '2'){
            const data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['G_ZY'],
                filter: {
                    prefix: this.queryForm.statusFacultyList,
                    specilaCode: 'XY2ZY',
                    grade: this.queryForm.grade,
                    facultys: this.queryForm.statusFacultyList,
                    degreeType: this.queryForm.degreeType ? [this.queryForm.degreeType] : []
                }
            }
            queryDic(data).then(res => {
                if (res.code === 200) this._fill('statusMajorList', res.data.G_ZY)
            })

        }
        },
        fillSelect(data) {
            this._fill('trainingLevel', data.X_PYCC)
            this._fill('faculty', data.X_YX)
            this._fill('formLearning', data.X_XXXS)
            this._fill('trainingCategory', data.X_PYLB)
            this._fill('degreeType', data.X_XWLX)
            this._fill('enrolSeason', data.X_RXJJ)
            this._fill('leaveSchool', data.X_LXZT)
            this._fill('campus', data.X_XQ)
            this._fill('isOverseas', data.isAborad)
            this._fill('sex', data.G_XBIE)
            this._fill('isMembership', data.K_SF)
            this._fill('chinaSon', data.gat)
            this._fill('enrolMethods', data.X_RXFS)
            this._fill('enrolCategory', data.X_LQLB)
            this._fill('degreeCategory', data.X_XWLB)
            this._fill('unionType', data.K_HZLX)
            this._fill('isChinaSon', data.K_SF)
            this._fill('specialPlanList', data.X_ZXJH)
            this._fill('category', data.G_ML)
        },
        _fill(type, data) {
            for (const key in data) {
                this.options[type].push({
                    value: key,
                    label: data[key]
                })
            }
        },
        /**
         * 查询学生信息
         * @isActiveTrigger 是否为主动触发查询
         * @isFirstPage 是否第一页
         */
        onSubmit(isActiveTrigger = true, isFirstPage = true) {
            if (isFirstPage) {
                this.queryForm.pageNum_ = 1
            }
            if (isActiveTrigger && this.studentIdList != null) {
                this.studentIdList = null
            }
            let param = null
            if (this.studentIdList) {
                param = {
                    studentIdList: this.studentIdList,
                    pageNum_: this.queryForm.pageNum_,
                    pageSize_: this.queryForm.pageSize_,
                    advanceType: 1
                }
            } else {
                param =  UTILS.clone(this.queryForm)
            }
            // 处理在校状态
            param.leaveSchool = param.leaveSchool && param.leaveSchool.length > 0 ? param.leaveSchool.join(',') : ''
            // 处理培养类别
            param.trainingCategory = param.trainingCategory && param.trainingCategory.length > 0 ? param.trainingCategory.join(',') : ''
            // 处理学位类型
            param.degreeType = param.degreeType && param.degreeType.length > 0 ? param.degreeType.join(',') : ''
            // 处理学位上报类别
            param.degreeCategory = param.degreeCategory && param.degreeCategory.length > 0 ? param.degreeCategory.join(',') : ''
            // 处理校区
            param.campus = param.campus && param.campus.length > 0 ? param.campus.join(',') : ''
            findStuInfoList(param).then(response => {
                if (response.code === 200) {
                    this.students = response.data.list
                    this.queryForm.total = response.data.total_
                } else throw response.code
            })
        },
        /**
         * 查询学生信息
         * 根据学生或导师查询
         */
        queryByCode() {
            let params = {}
            this.queryForm.pageNum_ = 1
            params['pageNum_'] = 1
            params['pageSize_'] = 20
            // 按学生搜索
            if (this.queryForm.statue === 0) {
                params['statue'] = 0
                params['name'] = this.queryForm.name.trim()
            } else { // 按导师搜索
                params['statue'] = 1
                params['teacherCodeAndName'] = this.queryForm.teacherCodeAndName.trim()
            }
            findStuInfoList(params).then(response => {
                if (response.code === 200) {
                    this.students = response.data.list
                    this.queryForm.total = response.data.total_
                } else throw response.code
            })
        },
        handleCurrentChange(val) {
            this.queryForm.pageNum_ = val
            this.onSubmit(false, false)
        },
        handleSizeChange(val) {
            this.queryForm.pageSize_ = val
            this.onSubmit(false)
        },
        viewDetail(studentId) {
            this.studentId = studentId
            this.indexKey = '2'
        },
        reset() {
            this.queryForm.grade = this.defaultGrade
            this.queryForm.facultyList = []
            this.queryForm.professionList = []
            this.queryForm.trainingLevelList = []
            this.queryForm.trainingCategory = []
            this.queryForm.degreeType = []
            this.queryForm.campus = []
            this.queryForm.sex = null
            this.queryForm.formLearning = null
            this.queryForm.enrolMethods = null
            this.queryForm.isOverseas = '0'
            this.queryForm.chinaSon = null
            this.queryForm.enrolSeason = null
            this.queryForm.enrolCategoryList = []
            this.queryForm.isMembership = null
            this.queryForm.leaveSchool = []
            this.queryForm.name = ''
            this.queryForm.teacherCodeAndName = ""
            this.queryForm.statue = 0
            this.queryForm.schoolId = null
            this.queryForm.degreeCategory = []
            this.queryForm.unionType = null
            this.queryForm.enrolGrade = ''
            this.queryForm.statusFacultyList = []
            this.queryForm.majorDirectionCode = ''
            this.queryForm.statusProfession = ''
            this.queryForm.specialPlan = ''
            this.options.profession = []
            this.onSubmit()
        },
        getSexLabel(val) {
            if (val == 1) {
                return '男'
            } else if (val == 2) {
                return '女'
            }
            return null
        },
        getIsOverseas(val) {
            return val == 1 ? '是' : '否'
        },
        //高级查询
        advanceQuery(data) {
            this.studentIdList = data
            this.queryForm.pageNum_ = 1
            let param = {
                studentIdList: data,
                pageNum_: this.queryForm.pageNum_,
                pageSize_: this.queryForm.pageSize_,
                advanceType: 1
            }
            findStuInfoList(param).then(response => {
                if (response.code === 200) {
                    this.students = response.data.list
                    this.queryForm.total = response.data.total_
                }
            })
        },
        getExportParamMethod() {
            /*debugger;*/
            if (this.studentIdList) {
                return {
                    method: 'post',
                    params: {
                        pageNum_: 1,
                        pageSize_: 20,
                        ids: this.exportSchemeId,
                        studentIdList: this.studentIdList
                    },
                    condition: false
                }
            } else {
                let params = _.cloneDeep(this.queryForm)
                params.faculty = params.facultyList.join(',')
                params.profession = params.professionList.join(',')
                params.trainingLevel = params.trainingLevelList.join(',')
                params.enrolCategory = params.enrolCategoryList.join(',')
                params.trainingCategory = params.trainingCategory.join(',')
                params.leaveSchool = params.leaveSchool.join(',')
                // params.facultyList = null
                // params.professionList = null
                // params.trainingLevelList = null
                // params.enrolCategoryList = null
                params.pageSize_ = null
                let paramsObj = {}
                for (let key in params) {
                    if (params[key] != null && params[key] != '') {
                        paramsObj[key] = params[key]
                    }
                }
                paramsObj['schemeId'] = this.exportSchemeId
                paramsObj['ids'] = this.ids
                return {
                    method: 'post',
                    params: paramsObj,
                    condition: true
                }
            }
        },
        handleCommand(command) {
            if (command == 'download') {
                window.open(getImportTemplate())
            } else {
                this.$refs.uploadDialog.open()
                this.clearFiles()
            }
        },
        handleSuccess(res, file, fileList) {
            if (res.code == 200) {
                this.$message({
                    type: 'success',
                    message: this.$t('common.tips.uploadSuccess')
                })
                this.$refs.uploadDialog.close()
                this.advanceQuery(res.data)
            } else {
                let msg = ''
                res.data.forEach(m => {
                    msg += "<div style='margin:5px 0'>" + m + '</div>'
                })
                this.$message({
                    duration: 5000,
                    type: 'error',
                    dangerouslyUseHTMLString: true,
                    message: msg
                })
                this.clearFiles()
            }
        },
        handleError(err, file, fileList) {
            let msg = JSON.parse(err.message)
            this.$message({
                type: 'error',
                message: msg.message
            })
        },
        clearFiles() {
            if (this.$refs.upload) this.$refs.upload.clearFiles()
        },
        handleBefore(file) {
            const isLt2M = file.size / 1024 / 1024 < 10
            if (!isLt2M) {
                this.$message.error('上传文件大小不能超过 10MB!')
                this.clearFiles()
                return false
            }
            const types = ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
            if (!types.includes(file.type)) {
                this.$message.error('上传文件格式必须是.xlsx')
                this.clearFiles()
                return false
            }
        },
        cancelUpload() {
            this.$refs.uploadDialog.close()
        },
        submit() {
            if (this.$refs.upload.uploadFiles.length == 0) {
                this.$message.error('请选择导入查询的文件')
                return
            }
            this.$refs.upload.submit()
        },
        handleChangeScheme(schemeId) {
            this.exportSchemeId = schemeId
        },
        mockData() {
            let students = []
            for (let i = 0; i < 1000; i++) {
                students.push({
                    advanceType: null,
                    campus: '1',
                    campusI18n: '四平路校区',
                    chinaSon: '否',
                    chinaSonI18n: '',
                    degreeCategory: null,
                    degreeCategoryI18n: '',
                    degreeType: null,
                    degreeTypeI18n: '',
                    deptIds: null,
                    dic: true,
                    enrolCategory: null,
                    enrolCategoryI18n: '',
                    enrolCategoryList: null,
                    enrolMethods: null,
                    enrolMethodsI18n: '',
                    enrolSeason: '1',
                    enrolSeasonI18n: '秋季',
                    faculty: '000039',
                    facultyI18n: '国际文化交流学院',
                    facultyList: null,
                    formLearning: '1',
                    formLearningI18n: '全日制',
                    grade: '2019',
                    idList: null,
                    ids: null,
                    isMembership: '0',
                    isMembershipI18n: '否',
                    isOverseas: '1',
                    isOverseasI18n: '是',
                    leaveSchool: [3],
                    leaveSchoolI18n: '不在读',
                    name: '黄昇渊',
                    nameList: null,
                    pageNum_: 1,
                    pageSize_: 10,
                    profession: '01245',
                    professionI18n: '',
                    professionList: null,
                    professionName: '医学院专业大类',
                    projId: '1',
                    registrationStatus: null,
                    registrationStatusI18n: '',
                    schoolId: null,
                    schoolName: null,
                    sex: 1,
                    sexI18n: '男',
                    sqlStr: null,
                    studentId: '1956102',
                    studentIdList: null,
                    studentIds: null,
                    trainingCategory: null,
                    trainingCategoryI18n: '',
                    trainingLevel: '1',
                    trainingLevelI18n: '本科',
                    trainingLevelList: null,
                    unionType: null,
                    unionTypeI18n: null
                })
            }
            this.students = students
            this.queryForm.total = students.length
        }
    }
}
</script>
<style scoped>
#faculty span .el-select__tags-text {
    width: 0;
}
</style>
<style lang="scss" scoped>
.condition {
    ::v-deep .el-select__tags {
        span span:only-child {
            text-overflow: ellipsis;
            overflow: hidden;
            // width: 200px;
        }
        & > span > span:first-child {
            padding-left: 0;
            margin-left: 8px;
        }
        span span:nth-last-child(2) {
            text-overflow: ellipsis;
            overflow: hidden;
            // width: 110px;
        }
        input {
            display: none;
        }
    }
}
</style>
